# -*- coding: utf-8 -*-
"""
@Time ： 2022/3/5 14:17
@Auth ： Mr. William 1052949192
@Company ：特斯汀学院 @testingedu.com.cn
@Function ：请输入模块功能描述
"""
import requests

session = requests.Session()


def param_to_data(params=''):
    if params:
        data_dict = {}
        # 先用&把键值对切割
        key_values = params.split('&')
        # 遍历键值对
        for key_value in key_values:
            # 用等号把键和值切割出来
            temp = key_value.split('=')
            key = temp[0]
            try:
                value = temp[1]
            except:
                value = ''

            data_dict[key] = value

        return data_dict
    else:
        return {}

result = session.post('http://yq.zsacloud.zhonshian.com/dev-school-api-v2/school-distribution-third/wlDeliveryInformation/addSchoolCanteen',
             data=param_to_data('organizationId=3533616&permitnumberno=JY33310820248892&innerId=99989131&innerName=%E5%A4%A9%E6%99%93%E9%A3%9F%E5%A0%820022'))
print(result.text)

